<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>API文档</title>

    <link rel="stylesheet" type="text/css" href="#{href '/public/apidoc/layout/layout_head.css'/}"/>
    <link rel="stylesheet" type="text/css" href="#{href '/public/apidoc/layout/base.css'/}"/>
    <link rel="stylesheet" type="text/css" href="#{href '/public/apidoc/layout/lib.css'/}"/>
    <link rel="stylesheet" type="text/css" href="#{href '/public/apidoc/layout/page_resource.css'/}"/>
    <link rel="stylesheet" type="text/css" href="#{href '/public/apidoc/font-awesome-4.7.0/css/font-awesome.min.css'/}">
    <link rel="stylesheet" type="text/css" href="#{href '/public/apidoc/base.css'/}">
    <link rel="stylesheet" type="text/css" href="#{href '/public/apidoc/prism.css'/}">


    <script src="#{href '/public/apidoc/jquery-2.2.0.min.js'/}"></script>
    <script src="#{href '/public/apidoc/marked.js'/}"></script>
    <script src="#{href '/public/apidoc/common.js'/}"></script>
    <script src="#{href '/public/apidoc/prism.js'/}"></script>
</head>
<body>
<div id="body" class="body page_resource">
    <div class="container_box cell_layout side_l">
        <div class="container_hd">
            <h2>&{'apidoc.name'}-API文档</h2>
            <div class="search_box wiki_side" #{ifnot isSearchEnable} style="display: none" #{/ifnot}>
                <span class="frm_input_box search with_del append">
                    <a id="search_btn" href="javascript:;" class="frm_input_append">
                        <i class="icon20_common search_gray">搜索</i>
                    </a>
                    <input id="search_text" type="text" name="" maxlength="60" class="frm_input" placeholder="URL、API名称、实体类">
                </span>
                <div id="result-list">

                </div>
            </div>
        </div>
        <div class="container_bd">
            <div id="col_side" class="col_side">
                <div class="menu_box_primary">
                    <dl class="menu_primary">
                        <div id="top-menu">
                        </div>
                        %{
                            def menuCateId = 0;
                        }%
                        #{if indexFile?.exists()}
                        <div class="menu-cate" id="menu-cate-box-${menuCateId}">
                        <dt class="menu_title_primary hide" id="menu-cate-${menuCateId}">
                            指引
                            <a href="javascript:;" class="set-top"><i class="fa fa-crosshairs" aria-hidden="true"></i></a>
                        </dt>

                        <dd class="menu_desc_primary" ref="menu-cate-${menuCateId}">
                            <dl class="sub_menu_primary">

                                <dt class="sub_menu_title_primary">
                                    <a href="/@apidoc/" class="menu_link_primary no_sub" menu="index">
                                        首页
                                    </a>
                                </dt>

                                #{list items: docDir.listMarkdownFiles(), as: 'mdFile'}
                                <dt class="sub_menu_title_primary">
                                    <a href="/@apidoc/doc/${mdFile.name}" class="menu_link_primary no_sub" menu="${mdFile.name}">
                                        ${mdFile.loadTitle()}
                                    </a>
                                </dt>
                                #{/list}

                            </dl>
                        </dd>
                        </div>
                        %{menuCateId++}%
                        #{/if}

                        #{list items:apiClassList, as: 'apiClass'}
                        <div class="menu-cate" id="menu-cate-box-${menuCateId}">
                        <dt class="menu_title_primary hide" id="menu-cate-${menuCateId}">
                            ${apiClass.getApiName()}
                            <a href="javascript:;" class="set-top"><i class="fa fa-crosshairs" aria-hidden="true"></i></a>
                        </dt>

                        <dd class="menu_desc_primary" ref="menu-cate-${menuCateId}">
                            <dl class="sub_menu_primary">
                                #{if apiClass.getApiService().md()}
                                %{def apiMd = play.Play.getVirtualFile('apidoc/' + apiClass.getApiService().md())}%
                                    #{if apiMd && apiMd.exists()}
                                    <dt class="sub_menu_title_primary">
                                        <a href="/@apidoc/doc/${apiMd.name}" class="menu_link_primary no_sub" menu="${apiMd.name}">
                                            ${apiMd.loadTitle()}
                                        </a>
                                    </dt>
                                    #{/if}
                                #{/if}
                                #{list items: apiClass.getApiActions(), as: 'apiAction'}
                                <dt data-leaf="1" class="sub_menu_title_primary">
                                    <a href="/@apidoc/api/${apiClass.getCanonicalName()}/${apiAction.getName()}" class="menu_link_primary no_sub" menu="${apiClass.getCanonicalName()}.${apiAction.getName()}">
                                        ${apiAction.getApiActionName()}
                                    </a>
                                </dt>
                                #{/list}

                            </dl>
                        </dd>
                        </div>
                        %{menuCateId++}%
                        #{/list}

                        #{list items: apiJsonList?.getJSONArray('api_services'), as: 'service'}
                        <div class="menu-cate" id="menu-cate-box-${menuCateId}">
                        <dt class="menu_title_primary  hide" id="menu-cate-${menuCateId}">
                            ${service.getString('title')}
                            <a href="javascript:;" class="set-top"><i class="fa fa-crosshairs" aria-hidden="true"></i></a>
                        </dt>

                        <dd class="menu_desc_primary" ref="menu-cate-${menuCateId}">
                            <dl class="sub_menu_primary">

                                #{list items: service.getJSONArray('apis'), as: 'api'}
                                <dt data-leaf="1" class="sub_menu_title_primary">
                                    <a href="/@apidoc/api_json/service/${service.getString('name')}/${api.getString('name')}" class="menu_link_primary no_sub" menu="${service.getString('name')}.${api.getString('name')}">
                                        ${api.getString('title')}
                                    </a>
                                </dt>
                                #{/list}

                            </dl>
                        </dd>
                        </div>
                        %{menuCateId++}%
                        #{/list}

                        #{if isAdmin}
                            <div class="menu-cate J-menu-cate-task" id="menu-cate-box-${menuCateId}">
                                <dt class="menu_title_primary no_sub  hide" id="menu-cate-${menuCateId}">
                                    <a href="@{XTasks.listTask}">任务管理</a>
                                </dt>
                            </div>
                            %{menuCateId++}%
                        #{/if}

                    </dl>


                    #{if session.contains('GODTEAM')}
                    <div class="menu-action-btns">
                        <a href="@{BaseCommonController.quit}">退出登录</a>
                    </div>
                    #{/if}
                </div>
            </div>
            <div class="col_main">
                #{doLayout /}
            </div>
        </div>
    </div>
</div>
<div class="foot" id="footer">
    <ul class="links ft">
        <li class="links_item no_extra">
            <p class="copyright">Copyright © &{'apidoc.copyright'}</p>
        </li>
    </ul>
</div>
</body>
</html>